package com.shoesmail.utils;

import org.springframework.stereotype.Component;

/**
 * @author ：xxx
 * @description：TODO
 * @date ：2025/9/17 9:17
 */

@Component
public class UserContext {
    private static final ThreadLocal<String> userHolder = new ThreadLocal<>();

    public static void setUserId(String userId) {
        userHolder.set(userId);
    }

    public static String getUserId() {
        return userHolder.get();
    }

    public static void removeUserId() {
        userHolder.remove();
    }
}
